<?php
require_once('\Views\PageView.php');
require_once('\Views\NavigationView.php');
require_once('\Views\LoginView.php');
require_once('\Controllers\LoginController.php');
require_once('\Controllers\ManageUsersController.php');
require_once('\Models\LoginModel.php');

class MasterController
{
	/**
	 * @return String HTML dokument för aktiv vy
	 */
	public static function createControl()
	{
		$pv = new PageView();
		$nv = new NavigationView();
		$lm = new LoginModel();
		$muc = new ManageUsersController();
		
		$html = LoginController::createControl(new LoginView());
		
		if($lm->IsLoggedIn())
		{
			$html .= $nv->getMenu();
			
			if($nv->isManagingUsers())
				$html .= $muc->createControl();	
		}
		
		return $pv->generateHTMLPage("Labb 3", $html);
	}
}

?>